
// request({ url: "http://www.baidu.com", method: "GET", data: {} })
const baseUrl = "https://meituan.thexxdd.cn/api/"

// let params={ url, method = "GET", data = {} }


import type { IParams } from "./type";
export const request = function (params: IParams) {
  return new Promise((resolve, reject) => {
    uni.request({
      url: baseUrl + params.url,
      method: params.method,
      data: params.data,
      success: res => {
        resolve(res)
      },
      fail: err => {
        reject(err)
      }
    })
  })
}